#include <stdio.h>

void num(int n) {
    int sum;
    for (int i = 1; i <= n; i++) {
        sum = 0;
        for (int j = 1; j <= i / 2; j++) {
            if (i % j == 0) {
                sum += j;
            }
        }
        if (sum == i) {
            printf("%d its factors are ", i);
            for (int j = 1; j <= i / 2; j++) {
                if (i % j == 0) {
                    printf("%d,", j);
                } 
            }
            printf("\n");
        }
    }
}

int main() {
    int n;
    printf("请输入一个正整数：");
    scanf("%d", &n);
    num(n);
    return 0;
}